package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.ysd.dao.Impl.CompanyDaoImpl;
import com.ysd.dao.Impl.ProductDaoImpl;
import com.ysd.dao.Impl.ScrollDaoImpl;
import com.ysd.entity.Company;
import com.ysd.entity.Product;
import com.ysd.entity.Scroll;

public class HeadServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//调用公司的实现类
		CompanyDaoImpl cDao=new CompanyDaoImpl();
		Company c=cDao.getCompany();
		request.setAttribute("c", c);
		
	    //调用轮播图的实现类
		ScrollDaoImpl sDao = new ScrollDaoImpl();
		List<Scroll> list = sDao.getScrollList();
		request.setAttribute("bannerList",list);
		request.getRequestDispatcher("head.jsp").include(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub  访问什么页面出的问题？ 演示一遍
		doGet(request, response);
	}

}
